import Moveable from "./moveable.js";
import Direction from "./direction.js";
import Tank from "./tank.js";
import config from "./gameconfig.js";

class Bullet extends Moveable {
    owner:Tank|null = null;
    attack:number = 0;
    constructor(x: number, y: number, imgSrc?: string | undefined, width?: number | undefined, height?: number | undefined, speed: number = 300, dir: Direction = Direction.TOP) {
        super(x, y, imgSrc, width, height, speed, dir);
        this.img.src = config.BulletSprite;
    }

    setOwner(tank:Tank):void{
        this.owner = tank;
        this.attack = tank.attack;
        this.direction = tank.direction;
    }
}
export default Bullet;